using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Table2Map : EntityTypeConfiguration<Table2>
    {
        public Table2Map()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.item)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Table2");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.price).HasColumnName("price");
            this.Property(t => t.item).HasColumnName("item");
            this.Property(t => t.price2).HasColumnName("price2");
        }
    }
}
